<layout name="page" />
<block name="content">
	{:widget('page_header/simple',array('name'=>'导入联系人'))}
	<form class="frame" method='post' id="form_data" enctype="multipart/form-data" class="">
		<input type="hidden" name="opmode" value="import">
		<div class="box">
			<label>1. 下载EXCEL模版</label><a class="btn btn-normal" href="/{:config('tpl_path')}/contact.xlsx" target="_blank"><i class="fa fa-download"></i>下载</a>
		</div>
		<div class="box">
			<label>2. 按照Excel格式整理，不要调整列循序</label>
		</div>
		<div class="box">
			<label>3. 选择要导入的文件</label>
		</div>
		<div class="box">
			<input type="file" name="uploadfile" value="" >
		</div>
		<div class="box">
			<a class="btn btn-normal" onclick="save();">导入</a>
			<a class="btn btn-return" onclick="go_return_url();">取消</a>
		</div>
	</form>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use(['global'], function() {
			var $ = layui.jquery;
			var fn = {
				save : function() {
					send_form("form_data", "{:url('import')}", "{:url('index')}", function(ret) {
						if (ret.status) {
							layer.msg(ret.info, {
								time : 1200
							}, function() {
								location.href = "{:url('index')}";
							});
						} else {
							layer.msg(ret.info);
							return false;
						}
					});
				}
			};
			win_exp(fn);
		});
	</script>
</block>